<?php
class StandingController extends Zend_Controller_Action {
	
	
	
	public function init()
    {
        /* Initialize action controller here */
    	$this->_helper->layout->setLayout ( 'layout' );

    }

    public function indexAction()
    {
    	
    	$page = $this->_getParam('page');
		if($page == ''){
			$page = 1;
		}
		
		$criteria = new Criteria();
		$cnt = UserTeamPeer::doCount($criteria);
		$criteria->add(UserTeamPeer::IS_ACTIVE,'Y');
		$criteria->add(UserTeamPeer::CURRENT_RANKING,NULL,Criteria::NOT_EQUAL);
		$criteria->addAscendingOrderByColumn(UserTeamPeer::CURRENT_RANKING);
		$criteria->setLimit(10);
		$criteria->setOffset(($page-1)*10);
		$userTeam = UserTeamPeer::doSelect($criteria);
		
		$this->view->userTeam = $userTeam;
		$this->view->page = $page;
		$this->view->count = $cnt;
    }

}

?>